#ifndef CITY_NODE_H_
#define CITY_NODE_H_

#include <string>
#include "math/vec2.h"
#include "ui/ui_sprite.h"

namespace city
{
class CityMap;
struct	CityData;

class	CityNode
{
public:
							CityNode(int NodeID, CityMap* pScene);
							~CityNode();
	void					RenderDebug(const math::Vec2& Offset);
	void					Render(const math::Vec2& Offset);
	void					Tick(float dt);
	bool					HitTest(const math::Vec2& Pos);
	static int				Sort(CityNode* pA, CityNode* pB) { return pA->GetID() - pB->GetID(); };
	int						GetID() const { return m_ID; };
	const std::string&		GetType() const { return m_Type; };
	void					SetType(const std::string&		Str) { m_Type = Str; };
	int						GetQuality() const { return m_Quality; };
	void					SetQuality(int ID);
	int						GetOwner() const { return m_Owner; };
	void					SetOwner(int ID);
	const math::Vec2&		GetPos() { return m_Pos; };
	void					SetPos(const math::Vec2& P) { m_Pos = P; };
	unsigned int			GetColor();
	float					GetRadius();
	bool					IsMouseOver(const math::Vec2& Offset);
	bool					IsInside(const math::Vec2& Pos);
	virtual void			OnClick();
	bool					TestName(const std::string& Name);
private:
	CityMap*				m_pScene;
	math::Vec2				m_Pos;
	int						m_ID;
	std::string				m_Type;
	int						m_Quality;
	int						m_Owner;

	// visuals
	ui::UISprite			m_CityOver;
	ui::UISprite			m_CityOff;
	ui::UISprite			m_Flag;

	CityData*				m_pData;

};

} // namespace city

#endif // CITY_NODE_H_